<?php

Class Tool
{
	static function redirect_post($url, array $post_data) {
      echo "<form action='" . $url . "' method='post' name='frm'>";
	  foreach($post_data as $key=>$value)
	  {
		  echo "<input type='hidden' name='" . $key . "' value='" . $value . "'>";
	  }
	  echo "</form>";
	  echo "<script language='JavaScript'>";
	  echo "document.frm.submit();";
	  echo "</script>";
	}
	
	static function encode($str) {
      return addslashes(htmlspecialchars($str));
	}
}
?>